﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace BLL.SysManage
{
    public class T_PUB_BROADCAST
    {
        private readonly DALL.SysManage.T_PUB_BROADCAST dal = new DALL.SysManage.T_PUB_BROADCAST();
        public T_PUB_BROADCAST()
        { }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetBroadcastList(int branch_id)
        {
            string strWhere = "";
            if (branch_id != -1)
            {
                strWhere += string.Format(" and c.BRANCH_ID = {0}", branch_id);
            }
            return dal.GetBroadcastList(strWhere);
        }

        /// <summary>
        /// 更新一条数据
        /// </summary>
        public void UpdateData(IList<Model.SysManage.T_PUB_BROADCAST> modelList)
        {
             dal.UpdateData(modelList);
        }

        /// <summary>
        /// 更新一条数据
        /// </summary>
        public void AddData(IList<Model.SysManage.T_PUB_BROADCAST> modelList)
        {
            dal.AddData(modelList);
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List<Model.SysManage.T_PUB_BROADCAST> GetListByBranch(int branch_id)
        {
            string strWhere = " 0< 1";
            if (branch_id != -1)
            {
                strWhere += string.Format(" and BRANCH_ID = {0}", branch_id);
            }
            return dal.GetListArray(strWhere);
        }

        #region  Method

        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(Model.SysManage.T_PUB_BROADCAST model)
        {
            return dal.Add(model);
        }

        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(Model.SysManage.T_PUB_BROADCAST model)
        {
            return dal.Update(model);
        }

        /// <summary>
        /// 删除一条数据
        /// </summary>
        public bool Delete(int ID)
        {

            return dal.Delete(ID);
        }

        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Model.SysManage.T_PUB_BROADCAST GetModel(int ID)
        {

            return dal.GetModel(ID);
        }    

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetList(string strWhere)
        {
            return dal.GetList(strWhere);
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List<Model.SysManage.T_PUB_BROADCAST> GetModelList(string strWhere)
        {
            return dal.GetListArray(strWhere);
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetAllList()
        {
            return GetList("");
        }
        #endregion
    }
}
